package cn.school.service;

import org.apache.ibatis.session.SqlSession;

import cn.school.dao.StudentDao;
import cn.school.dao.SubjectDao;
import cn.school.entity.Student;
import cn.school.entity.Subject;
import cn.school.util.BatisUtil;

public class SubjectService {
	public int add(Subject s) throws Exception {
		SqlSession s1 = BatisUtil.createSqlSession();
		try {
			SubjectDao st = s1.getMapper(SubjectDao.class);
			return st.add(s);
		} finally {
			BatisUtil.closeSqlSession(s1);
		}
	}
}
